//
//  FirstGesterTableViewCell.m
//  GoShops
//
//  Created by zcj on 15-12-2.
//  Copyright (c) 2015年 郑朝军. All rights reserved.
//

#import "FirstGesterTableViewCell.h"
#import "ShopGesterHomeRecommModel.h"
#import "Grouble.h"
#import "UIImage+MJ.h"

@interface FirstGesterTableViewCell()
@property (nonatomic,weak)UIImageView *topImageView;
@property (nonatomic,weak)UIImageView *topImage;
@property (nonatomic,weak)UILabel * myLable;
@property (nonatomic,weak)UIImageView *topLeftView;

@property (nonatomic,weak)UILabel * priceLabels;
@property (nonatomic,weak)UIButton * lijiQiangGou;

@end
@implementation FirstGesterTableViewCell

+ (instancetype)FirstGesterTableViewCell:(UITableView *)tableView
{
    static NSString *ID = @"firstGester";
    FirstGesterTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[FirstGesterTableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
    }
    // 选中无颜色
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return cell;
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        UILabel * priceLabels = [[UILabel alloc]initWithFrame:CGRectMake(0, 125, 80, 35)];
        priceLabels.text = @"6.6元";
        
        priceLabels.textAlignment = NSTextAlignmentLeft;
        priceLabels.textColor = ZCJColor(66, 200, 185);
        priceLabels.font = [UIFont systemFontOfSize:25];
        [self addSubview:priceLabels];
        self.priceLabels = priceLabels;
        
        NSString * str = @"郑朝军";
        
        CGSize myLableWH = [str sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:20]}];
        
        UILabel * myLable = [[UILabel alloc]initWithFrame:CGRectMake(135, 128,myLableWH.width, myLableWH.height)];
        myLable.numberOfLines = 0;
        myLable.text = str;
        myLable.font = [UIFont systemFontOfSize:14];
        myLable.textAlignment = NSTextAlignmentCenter;
        
        [self addSubview:myLable];
        self.myLable = myLable;
        
        //self.imageView.contentMode = UIControlContentHorizontalAlignmentLeft;
        
        self.imageView.image = [UIImage imageNamed:@"icon_deal_campaign"];
        
        // 右边的view
        //UIImage * LeftMyImg = [UIImage imageNamed:@"bg_mine_btn_notice"];
        //UIImage * LeftMyImg = [UIImage resizedImageWithName:@"bg_mine_btn_notice"];
        UIButton * lijiQiangGou = [UIButton buttonWithType:UIButtonTypeRoundedRect];
        [lijiQiangGou setBackgroundImage:[UIImage resizedImageWithName:@"bg_mine_btn_notice"] forState:UIControlStateNormal];
        [lijiQiangGou setTitle:@"立即抢购" forState:UIControlStateNormal];
        CGFloat lijiQiangGouX = ScreenWidth - 100;
        
        lijiQiangGou.frame = CGRectMake(lijiQiangGouX, 125, 80, 35);
        [self addSubview:lijiQiangGou];
        self.lijiQiangGou = lijiQiangGou;
        
    }
    return self;
}
// 设置数据
- (void)setShopGesterRecommModel:(ShopGesterHomeRecommModel *)shopGesterRecommModel
{
    _shopGesterRecommModel = shopGesterRecommModel;
    ZCJLog(@"%@",shopGesterRecommModel.title);
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.imageView.frame = CGRectMake(0, 0, ScreenWidth, 120);
    

}
- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
